<%@ page contentType="text/html; charset=UTF-8" isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html LANG="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>搜索词统计</title>
<link href="bootstrap/css/bootstrap.css" rel="stylesheet">
<link type="image/x-icon" rel="shortcut icon" href="favicon.ico" />
<script src="scripts/jquery.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
<script src="bootstrap/js/bootstrap-paginator.js"></script>
<!--[if lt IE 9]>
  <script src="bootstrap/js/html5shiv.min.js"></script>
  <script src="bootstrap/js/respond.min.js"></script>
<![endif]-->
</head>
<body>
	<nav class="navbar navbar-default" role="navigation">
   		<div class="navbar-header">
      		<a class="navbar-brand" href="index.html"><strong>卓越搜索</strong></a>
   		</div>
   		<div>
      		<ul class="nav navbar-nav">
         		<li><a href="index.html">主页</a></li>
         		<li><a href="setting">设置</a></li>
         		<li class="active"><a href="stat">搜索词</a></li>
      		</ul>
    	</div>
	</nav>
	<div style="padding: 0px 10px 10px;">
		<div class="container">
			<h5>记录数：${total}</h5>
			<table class="table table-bordered">
			<thead>
		      	<tr>
		         	<th>排名</th>
		         	<th>搜索词</th>
		         	<th>搜索次数</th>
		      	</tr>
		   	</thead>
		   	<tbody>
				<c:forEach var="result" items="${results}" varStatus="status">
		      	<tr>
					<td><span class="badge">${result.sequenceNum}</span></td>
					<td>${result.searchWord}</td> 
					<td>${result.counts}</td>
				</tr>
				</c:forEach>
			</tbody>
			</table>
			<c:if test="${0 ne results.size()}">
				<div>
					<ul id="pager"></ul>
				</div>
			</c:if>
		</div>
	</div>
</body>
<script type="text/javascript">
	$(function() {
		var options = {
			bootstrapMajorVersion : 3,
			currentPage : '${currentPage}',
	        numberOfPages : 10,
			totalPages : '${totalPages}',
			pageUrl : function(type, page, current) {
				return "javascript:formSubmit('" + page + "');";
			}
		}
		$('#pager').bootstrapPaginator(options);
	});

	function formSubmit(currentPage) {
		window.location = 'stat?currentPage=' + currentPage;
	}
</script>
</html>